package com.lk.ii.service.impl;

import java.util.List;
import com.lk.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.lk.ii.mapper.IiAuthorMapper;
import com.lk.ii.domain.IiAuthor;
import com.lk.ii.service.IIiAuthorService;
import com.lk.common.core.text.Convert;

/**
 * 作者Service业务层处理
 * 
 * @author lk
 * @date 2021-02-02
 */
@Service
public class IiAuthorServiceImpl implements IIiAuthorService 
{
    @Autowired
    private IiAuthorMapper iiAuthorMapper;

    /**
     * 查询作者
     * 
     * @param id 作者ID
     * @return 作者
     */
    @Override
    public IiAuthor selectIiAuthorById(Long id)
    {
        return iiAuthorMapper.selectIiAuthorById(id);
    }

    /**
     * 查询作者列表
     * 
     * @param iiAuthor 作者
     * @return 作者
     */
    @Override
    public List<IiAuthor> selectIiAuthorList(IiAuthor iiAuthor)
    {
        return iiAuthorMapper.selectIiAuthorList(iiAuthor);
    }

    /**
     * 新增作者
     * 
     * @param iiAuthor 作者
     * @return 结果
     */
    @Override
    public int insertIiAuthor(IiAuthor iiAuthor)
    {
        iiAuthor.setCreateTime(DateUtils.getNowDate());
        return iiAuthorMapper.insertIiAuthor(iiAuthor);
    }

    /**
     * 修改作者
     * 
     * @param iiAuthor 作者
     * @return 结果
     */
    @Override
    public int updateIiAuthor(IiAuthor iiAuthor)
    {
        iiAuthor.setUpdateTime(DateUtils.getNowDate());
        return iiAuthorMapper.updateIiAuthor(iiAuthor);
    }

    /**
     * 删除作者对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteIiAuthorByIds(String ids)
    {
        return iiAuthorMapper.deleteIiAuthorByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除作者信息
     * 
     * @param id 作者ID
     * @return 结果
     */
    @Override
    public int deleteIiAuthorById(Long id)
    {
        return iiAuthorMapper.deleteIiAuthorById(id);
    }
}
